package router

import (
	"github.com/gin-gonic/gin"
	"seat-service/api"
)

var reserveApi api.ReserveApi

type reserveRouter struct {
}

func (*reserveRouter) reserveGroup(Router *gin.RouterGroup) *gin.RouterGroup {
	reserve := Router.Group("reserve")
	{
		reserve.GET("get", reserveApi.GetReserve)                   //获取预约的教室记录
		reserve.POST("save", reserveApi.Save)                       // 保存预约（教室，座位，预约时间），预约成功 将key：“reserve/学生id/预约开始时间” “需要签到的最晚时间”为value 存在redis中
		reserve.POST("signIn", reserveApi.SignIn)                   // 签到（可以判断重复签到，签到超时，签到成功）
		reserve.GET("/check/status", reserveApi.CheckStudentStatus) //检查当前预约的学生的学生状态

		reserve.GET("/get/seat", reserveApi.GetOptionalSeats)     // 一键预约
		reserve.POST("/cancel/reserve", reserveApi.CancelReserve) //取消预约
		reserve.POST("/cancel/use", reserveApi.CancelUse)         //取消使用

		//续约
		reserve.POST("renewal", reserveApi.Renewal)
		//申诉
		reserve.GET("appeal", reserveApi.Appeal)
	}
	return reserve
}
